package com.itheima.api.treemap.demo02;

import java.util.TreeMap;

public class Student_String {

    public static void main(String[] args) {

        Student s1 = new Student("蓝湛", 16);
        Student s2 = new Student("魏婴", 15);
        Student s3 = new Student("江澄", 14);
        Student s4 = new Student("蓝湛", 16);

        TreeMap<Student, String> treeMap = new TreeMap<Student, String>();

        treeMap.put(s1, "云深不知处");
        treeMap.put(s2, "夷陵");
        treeMap.put(s3, "莲花坞");
        treeMap.put(s1, "云深不知处");

        for (Student s : treeMap.keySet()){
            System.out.println(s.getName() + "---" + s.getAge() + "---" + treeMap.get(s));
        }
    }
}
